package com.enjoyor.soa.traffic.rest.tsms.dubbo.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONArray;
import com.enjoyor.soa.traffic.api.dto.tsms.AssessItemsScoreDto;
import com.enjoyor.soa.traffic.api.dto.tsms.PoliceAssessDto;
import com.enjoyor.soa.traffic.api.dto.tsms.RltRouteDeviceDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tsms.IDubboPoliceAssessService;
import com.enjoyor.soa.traffic.rest.tsms.dubbo.IPoliceAssessConsumeService;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Component
public class PoliceAssessConsumeService implements IPoliceAssessConsumeService{

	@Reference(version = "1.0.0", timeout = 10000)
	private IDubboPoliceAssessService iDubboPoliceAssessService;
	@Override
	public ResultPojo getPoliceAssessPage(Page page, String assessId, String executeTaskId, String policeId) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboPoliceAssessService.getPoliceAssessPage(page, assessId, executeTaskId, policeId);
		return resultPojo;
	}

	@Override
	public ResultPojo getPoliceAssessList(String assessId, String executeTaskId, String policeId) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboPoliceAssessService.getPoliceAssessList(assessId, executeTaskId, policeId);
		return resultPojo;
	}

	@Override
	public ResultPojo insertPoliceAssess(PoliceAssessDto policeAssessDto, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboPoliceAssessService.insertPoliceAssess(policeAssessDto, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo editPoliceAssess(PoliceAssessDto policeAssessDto, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboPoliceAssessService.editPoliceAssess(policeAssessDto, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo deletePoliceAssess(String assessId, String executeTaskId, String policeId, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboPoliceAssessService.deletePoliceAssess(assessId, executeTaskId, policeId, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo assessPoliceScore(PoliceAssessDto policeAssessDto, String list, String personName) {
		// TODO Auto-generated method stub
		List<AssessItemsScoreDto> listAssessScore = JSONArray.parseArray(list, AssessItemsScoreDto.class);
		return iDubboPoliceAssessService.assessPoliceScore(policeAssessDto, listAssessScore, personName);
	}

}
